<style type="text/css">
    div.container {
        padding: .8em;
        margin-bottom: 1em;
        border-top: 1px solid #ddd;
        border-bottom: 1px solid #ddd;
        background: #FBE3E4;
        color: #8a1f11;
    }
    div.container label { padding-right: 30px; }
    div.container input.checkbox { vertical-align: middle; }
    .hide { display: none; }
    h2.icon {
        height: 40px; line-height: 40px; font: 2.2em Georgia,serif;
        padding: 0; margin: 10px 0; color: #428a0a;
        background: url(<?php Yii::app()->baseUrl; ?>/assets/backend/images/clear.gif) no-repeat left 50%; padding-left: 50px;
    }

    div.tips {
        padding: .8em;
        margin-bottom: 1em;
        border-top: 1px solid #ddd;
        border-bottom: 1px solid #ddd;
        background: #FBE3E4;
        color: #8a1f11;
    }
    div.tips h2 {
        background: url(images/warning.gif) no-repeat left 50%; padding-left: 30px;
    }
</style>
<h2 class="icon">Clear Cache</h2>
<?php
echo CHtml::beginForm();
?>
<div class="container">
    <div>
        <fieldset>
            <legend>
                <input type="checkbox" class="checkbox" onclick="$('input[name=\'cache_items[]\']').attr('checked', this.checked);" />
                <?php echo Yii::t('common', 'please_select'); ?>
            </legend>
            <?php
            $data = array(
                'cache_item_nodes_tree_for_datas_transfer' => Yii::t('utils', 'cache_item_nodes_tree_for_datas_transfer'),
                'cache_item_media_categories_for_change_media_category' => Yii::t('utils', 'cache_item_media_categories_for_change_media_category'),
            );
            echo CHtml::checkBoxList('cache_items', '', $data, array(
                'separator' => '',
                'class' => 'checkbox'
            ));
            ?>
        </fieldset>
    </div>
    <div style="margin: 10px 0;">
        <?php
        echo CHtml::ajaxSubmitButton(Yii::t('utils', 'clear_cache_btn_name'), array('utils/clearCache'), array(
        'type' => 'POST',
        'update' => '#tip_msg',
        'beforeSend' => 'function() { $("#tip_msg").addClass("datasLoading").removeClass("hide"); }',
        'complete' => 'function() { $("#tip_msg").removeClass("datasLoading").addClass("tips"); }',
        ), array('class' => 'btn'));

        ?>
    </div>
</div>
<?php echo CHtml::endForm(); ?>
<div id="tip_msg" class="hide"></div>
